package com.tyqx.hashchainbiz.service.impl;

import com.tyqx.hashchainbean.module.Authorize;
import com.tyqx.hashchainbean.vo.AuthorizeUpdateTimeVO;
import com.tyqx.hashchainbiz.service.AuthService;
import com.tyqx.hashchaindao.mapper.AuthorizeMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("authService")
public class AuthServiceImpl implements AuthService {

    @Resource
    private AuthorizeMapper authorizeMapper;


    public Integer grantee(Authorize authorize) {
        return authorizeMapper.add(authorize);
    }


    public Integer updateAuth(Integer recordId, String granteeId, String grantorId, Integer flag) {
        return authorizeMapper.updateAuth(recordId,granteeId,grantorId,flag);
    }


    public Integer updateAuthTime(AuthorizeUpdateTimeVO updateTimeVO) {
        return authorizeMapper.updateAuthTime(updateTimeVO);
    }


    public List<Authorize> gratneeAutho(String granteeUid, Integer flag) {
        return authorizeMapper.granteeGroup(granteeUid,flag);
    }


    public List<Authorize> gratneeUnautho(String granteeUid, Integer flag) {
        return authorizeMapper.granteeGroup(granteeUid,flag);
    }


    public List<Authorize> granteeUnauthoRefuse(String granteeUid, Integer flag) {
        return authorizeMapper.granteeGroup(granteeUid,flag);
    }


    public List<Authorize> gratnorAutho(String granteeUid, Integer flag) {
        return authorizeMapper.grantorGroup(granteeUid,flag);
    }


    public List<Authorize> gratnorUnautho(String granteeUid, Integer flag) {
        return authorizeMapper.grantorGroup(granteeUid,flag);
    }


    public List<Authorize> grantorUnauthoRefuse(String granteeUid, Integer flag) {
        return authorizeMapper.grantorGroup(granteeUid,flag);
    }
}
